package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 用户业务类型枚举
 */

@Getter
@AllArgsConstructor
public enum UserBusinessTypeEnum {

	SUPPLY(1, "采购"),
	SALES(2, "销售"),
	FINANCE(3, "财务"),
	SORTING(5, "分拣"),
	OTHER(4, "其他");
	/**
	 * 类型
	 */
	private Integer code;

	/**
	 * 描述
	 */
	private String description;

	public static UserBusinessTypeEnum get(Integer code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (UserBusinessTypeEnum userBusinessTypeEnum : UserBusinessTypeEnum.values()){
			if (code.equals(userBusinessTypeEnum.code))  return userBusinessTypeEnum;
		}
		return null;
	}
}
